package com.xiaomage.ipcdemo

import android.os.Handler
import android.os.Message
import android.util.Log
import com.xiaomage.ipcdemo.Constants.TAG

class MessageHandler:Handler() {
    override fun handleMessage(msg: Message?) {
        super.handleMessage(msg)
        if(msg?.what==Constants.MESSAGE_FROM_SERVICE){
            val pid=android.os.Process.myPid()
            Log.d(TAG,"pid:$pid")
            Log.d(TAG,"服务号回复的消息${msg?.data.getString(Constants.MESSAGE_KEY)}")
        }
    }
}